# -*- mode: Makefile -*-
#
# Copyright 2010 	Shane Conway and Dirk Eddelbuettel

RCPP_LDFLAGS	= `Rscript -e 'Rcpp:::LdFlags()'`

BIN		= RShark.dll
CXXFLAGS	= -I$(RHOME)/include -I$(RHOME)/library/Rcpp/include -I. -I$(SHARK_ROOT)/include -Wall -O2

SOURCES		:= $(wildcard *.cpp)
LINKOBJ		:= $(SOURCES:.cpp=.o)

DLLLIBS		= -s -L$(RHOME)/bin -lR $(RCPP_LDFLAGS) -L$(SHARK_ROOT)/lib -lshark

.PHONY: 	all clean

all: 		RShark.dll

clean:
		rm -f $(LINKOBJ) $(BIN)

$(BIN): 	$(LINKOBJ)
		$(CXX) -shared $(LINKOBJ) $(DLLLIBS) -o $(BIN)

